import random

car_park = [] # 无车辆
def enter():
    print('欢迎进入xx停车场')
    number = input('请输入车牌号：')
    car = {}
    car[number] = [0]
    car_park.append(car)
    print('{}车辆已进入'.format(number))

def go_out():
    number = input('请输入车牌号：')
    # 判断汽车是否进场
    for car in car_park:
        if number in car:
            # 计算停车时间
            time = random.randint(0,24)
            time_recode = car.get(number)
            time_recode.append(time)
            # 计算停车费用
            total = time * 4
            print('{}停车{}小时,应缴费：{}元'.format(number,time,total))
            print('车辆已离开')
        else:
            print('没有该车辆')

enter()
go_out()
